' Get picture width and height of class, support Jpg,gif,png,bmp 'Class Imgwhinfo Dim ASOPrivate Sub Class_InitializeSet aso=server.createobject ("ADODB. Stream ")ASO. Mode=3ASO. Type=1ASO. OpenEnd SubPrivate Sub Class_TerminateErr.ClearSet aso=nothingEnd Sub Private Function bin2str (Bin)Dim I, StrFor I=1 to LenB (Bin)CLOW=MIDB (bin,i,1)If ASCB (Clow) str = str CHR (ASCB (Clow))ElseI=i+1If I End IfNextBin
' The text watermark processing value assigned to BB, at this time, text watermark no opacity
' ============ Adjust text transparency ================
Set myjpeg = Server.CreateObject ("Persits.jpeg")
Myjpeg.openbinary AA
Set Logo = Server.CreateObject ("Persits.jpeg")
Logo.openbinary BB
Myjpeg.drawimage 0,0, Logo, 0.2 ' 0.3 is transparency
Cc=myjpeg.binary ' assigns the final result to CC, and you can also generate the target picture.
Response. BinaryWrite cc ' converts binary output t
, the text watermark has no opacity.'============== Adjust the text transparency ========================Set MyJpeg = Server. CreateObject ("Persits. Jpeg ")MyJpeg. OpenBinary aaSet Logo = Server. CreateObject ("Persits. Jpeg ")Logo. OpenBinary bbMyJpeg. DrawImage 0.2, Logo, '0. 3 is transparencyCc = MyJpeg. Binary assign the final result to cc, and the target image can also be generated.Response. BinaryWrite CC' will be output to the browser.MyJpeg. Save (server. mappath (paths + filename ))Set
Upload | No components I studied the no component upload, and made one of the simplest possible ways
----Use 9 lines of code to truly implement no component upload, how to say that spent half a day to write 9 lines of code is a bit of efficiency and results.
So I wrote this article.
Formsize=request.totalbytes ()
Formdata=request.binaryread (Formsize)
Dataheader=leftb (FORMDATA,INSTRB (FORMDATA,CHRB) AMP;CHRB (10))
Strfiledata=midb (Formdata,lenb (Dataheader), LenB (FormData)-lenb (dataheader
keytemp as StringDim Key1 as Byte
for k = 1 to keytemp = keytemp CStr (Int (RND * (9) + 1)) Next Key1 = CByte (Mid (Keytemp, one, 1) Mid (Keytemp, 1)) for i = 1 to Len (strsource) Strchar = Mid (strsource, I, 1) ' Remove a character from the string to be encrypted Blowdata = AscB (MidB (Strchar, 1, 1)) Xor Key1 ' take characters of low byte and Key1 for XOR operation shigdata =
Upload ' Upload.asp
Function Intmin (n,y)
If NIntmin=int (N)
ElseIf y>0 Then
Intmin=int (y)
Else
Intmin=n
End If
End Function
Function Getformvalue (Name)
Dim Formsize,formdata,dataheader,datastart,dataend,formnamestart,formnameend,formname,firstfilter
Formsize=request.totalbytes ()
Formdata=request.binaryread (Formsize)
Firstfilter=true
For I=1 to Len (Name)
TMP=TMPAMP;CHRB (AscB) (Mid (name,i,1))
Next
Name=tmp
Dataend=0
Datastart=0
Do While formsiz
Here is my GIF image format to determine the size of the GIF image, please give some advice
Up.htm
Up.asp
Formsize = Request.TotalBytes
FormData = Request.BinaryRead (formsize)
BNCRLF=CHRB (+) ChrB (10)
Divider=leftb (FORMDATA,INSTRB (FORMDATA,BNCRLF)-1)
DATASTART=INSTRB (Formdata,bncrlf Bncrlf) +4
DATAEND=INSTRB (Datastart+1,formdata,divider)-datastart
IMAGE=MIDB (Formdata,datastart,dataend)
Head_version = ASCB (MidB (image,1,3))
Head_subversion =
How to judge the size of GIF image
Here is my GIF image format to determine the size of the GIF image, please give some advice
Up.htm
Up.asp
Formsize = Request.TotalBytes
FormData = Request.BinaryRead (formsize)
BNCRLF=CHRB (+) ChrB (10)
Divider=leftb (FORMDATA,INSTRB (FORMDATA,BNCRLF)-1)
DATASTART=INSTRB (Formdata,bncrlf Bncrlf) +4
DATAEND=INSTRB (Datastart+1,formdata,divider)-datastart
IMAGE=MIDB (Formdata,datastart,dataend)
Head_version = AS
-encoded string.Stransi2unicode = ""Len1 = lenb (ascontents)If len1 = 0 Then exit functionFor I = 1 to len1Varchar = midb (ascontents, I, 1)Varasc = ASCB (varchar)If varasc> 127 thenStransi2unicode = stransi2unicode CHR (ASCW (midb (ascontents, I + 1, 1) varchar ))I = I + 1ElseStransi2unicode = stransi2unicode CHR (varasc)End ifNextEnd Function
Function base64encode (ascontents)'Encode the ANSI encoded string with base64'Ascontents should be an ANS
(ascontents)
' Converts an ANSI-encoded string into a Unicode-encoded string
Stransi2unicode = ""
Len1=lenb (ascontents)
If Len1=0 then Exit function
For I=1 to Len1
VARCHAR=MIDB (ascontents,i,1)
VARASC=ASCB (varchar)
If VARASC > 127 Then
Stransi2unicode = Stransi2unicode Chr (AscW (MidB (ascontents,i+1,1) varchar))
I=i+1
Else
Stransi2unicode = Stransi2unicode Chr (VARASC)
End If
Next
End Function
Function Base64Encode (ascontent
Here is my GIF image format to determine the size of the GIF image, please give some advice
Up.htm
Up.asp
Formsize = Request.TotalBytes
FormData = Request.BinaryRead (formsize)
BNCRLF=CHRB (+) ChrB (10)
Divider=leftb (FORMDATA,INSTRB (FORMDATA,BNCRLF)-1)
DATASTART=INSTRB (Formdata,bncrlf Bncrlf) +4
DATAEND=INSTRB (Datastart+1,formdata,divider)-datastart
IMAGE=MIDB (Formdata,datastart,dataend)
Head_version = ASCB (MidB (image,1,3))
Head_subve
Tags: character ctimob file encoding osi patmaintor meaning ' ******************************************************************* ' effect: Transfer convert file encoding format ' parameter meaning: Incode for incoming file encoding Outcode converted file Encoding ' to determine if the file type is ANSI type, if not, provide a choice whether you need to update the file automatically ' ******************************************************** Function read (path) turns the array of byte () into
Program | source code | source Code Class Imgwhinfo ' Get a picture of the width and height of classes, support Jpg,gif,png,bmp
Dim ASO
Private Sub Class_Initialize
Set aso=server.createobject ("ADODB. Stream ")
ASO. Mode=3
ASO. Type=1
ASO. Open
End Sub
Private Sub Class_Terminate
Err.Clear
Set aso=nothing
End Sub
Private Function bin2str (Bin)
Dim I, Str
For I=1 to LenB (Bin)
CLOW=MIDB (bin,i,1)
If ASCB (Clow) str = str CHR (
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.